home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Programming / Perl / lib / perl5 / 5.00502 / m68k-amigaos / Errno.pm < prev    next >
Encoding:
Perl POD Document  |  1990-01-01  |  5.2 KB  |  212 lines

  1. #
  2. # This file is auto-generated. ***ANY*** changes here will be lost
  3. #
  4.  
  5. package Errno;
  6. use vars qw(@EXPORT_OK %EXPORT_TAGS @ISA $VERSION %errno $AUTOLOAD);
  7. use Exporter ();
  8. use Config;
  9. use strict;
  10.  
  11. $Config{'myarchname'} eq "m68k-amigaos" or
  12.     die "Errno architecture (m68k-amigaos) does not match executable architecture ($Config{'myarchname'})";
  13.  
  14. $VERSION = "1.09";
  15. @ISA = qw(Exporter);
  16.  
  17. @EXPORT_OK = qw(EFAULT ENOSYS ENETDOWN EAFNOSUPPORT ENOEXEC EALREADY
  18.     EMSGSIZE ENOENT ECHILD EDEADLK ENOTBLK EISCONN EEXIST ERANGE
  19.     ECONNABORTED EUSERS EDESTADDRREQ EXDEV ESTALE ELOOP EISDIR
  20.     ERPCMISMATCH ENODEV ESHUTDOWN ECONNREFUSED ENOTTY ESOCKTNOSUPPORT
  21.     EADDRINUSE ENOTEMPTY ESPIPE E2BIG ENOPROTOOPT EFTYPE EREMOTE
  22.     ENETUNREACH EPIPE ENOTDIR ECONNRESET EPROCLIM EFBIG EIO EADDRNOTAVAIL
  23.     EROFS EINVAL ENOTCONN EACCES EAGAIN ENAMETOOLONG ENOSPC EHOSTUNREACH
  24.     ENOBUFS EMFILE EBADF ETXTBSY ENFILE EPFNOSUPPORT EWOULDBLOCK ENOLCK
  25.     EMLINK ENOMEM EINTR ENXIO EDOM ENOTSOCK EBUSY EPROCUNAVAIL
  26.     EPROGUNAVAIL ENETRESET ETIMEDOUT EINPROGRESS EBADRPC EDQUOT
  27.     EPROTONOSUPPORT EPROGMISMATCH ESRCH EPERM EHOSTDOWN EPROTOTYPE
  28.     ETOOMANYREFS EOPNOTSUPP);
  29.  
  30. %EXPORT_TAGS = (
  31.     POSIX => [qw(
  32.     E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY
  33.     EBADF EBUSY ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK
  34.     EDESTADDRREQ EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH
  35.     EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK
  36.     EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS
  37.     ENODEV ENOENT ENOEXEC ENOLCK ENOMEM ENOPROTOOPT ENOSPC ENOSYS ENOTBLK
  38.     ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM
  39.     EPFNOSUPPORT EPIPE EPROCLIM EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE
  40.     EROFS ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT
  41.     ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV
  42.     )]
  43. );
  44.  
  45. sub EPERM () { 1 }
  46. sub ENOENT () { 2 }
  47. sub ESRCH () { 3 }
  48. sub EINTR () { 4 }
  49. sub EIO () { 5 }
  50. sub ENXIO () { 6 }
  51. sub E2BIG () { 7 }
  52. sub ENOEXEC () { 8 }
  53. sub EBADF () { 9 }
  54. sub ECHILD () { 10 }
  55. sub EDEADLK () { 11 }
  56. sub ENOMEM () { 12 }
  57. sub EACCES () { 13 }
  58. sub EFAULT () { 14 }
  59. sub ENOTBLK () { 15 }
  60. sub EBUSY () { 16 }
  61. sub EEXIST () { 17 }
  62. sub EXDEV () { 18 }
  63. sub ENODEV () { 19 }
  64. sub ENOTDIR () { 20 }
  65. sub EISDIR () { 21 }
  66. sub EINVAL () { 22 }
  67. sub ENFILE () { 23 }
  68. sub EMFILE () { 24 }
  69. sub ENOTTY () { 25 }
  70. sub ETXTBSY () { 26 }
  71. sub EFBIG () { 27 }
  72. sub ENOSPC () { 28 }
  73. sub ESPIPE () { 29 }
  74. sub EROFS () { 30 }
  75. sub EMLINK () { 31 }
  76. sub EPIPE () { 32 }
  77. sub EDOM () { 33 }
  78. sub ERANGE () { 34 }
  79. sub EWOULDBLOCK () { 35 }
  80. sub EAGAIN () { 35 }
  81. sub EINPROGRESS () { 36 }
  82. sub EALREADY () { 37 }
  83. sub ENOTSOCK () { 38 }
  84. sub EDESTADDRREQ () { 39 }
  85. sub EMSGSIZE () { 40 }
  86. sub EPROTOTYPE () { 41 }
  87. sub ENOPROTOOPT () { 42 }
  88. sub EPROTONOSUPPORT () { 43 }
  89. sub ESOCKTNOSUPPORT () { 44 }
  90. sub EOPNOTSUPP () { 45 }
  91. sub EPFNOSUPPORT () { 46 }
  92. sub EAFNOSUPPORT () { 47 }
  93. sub EADDRINUSE () { 48 }
  94. sub EADDRNOTAVAIL () { 49 }
  95. sub ENETDOWN () { 50 }
  96. sub ENETUNREACH () { 51 }
  97. sub ENETRESET () { 52 }
  98. sub ECONNABORTED () { 53 }
  99. sub ECONNRESET () { 54 }
  100. sub ENOBUFS () { 55 }
  101. sub EISCONN () { 56 }
  102. sub ENOTCONN () { 57 }
  103. sub ESHUTDOWN () { 58 }
  104. sub ETOOMANYREFS () { 59 }
  105. sub ETIMEDOUT () { 60 }
  106. sub ECONNREFUSED () { 61 }
  107. sub ELOOP () { 62 }
  108. sub ENAMETOOLONG () { 63 }
  109. sub EHOSTDOWN () { 64 }
  110. sub EHOSTUNREACH () { 65 }
  111. sub ENOTEMPTY () { 66 }
  112. sub EPROCLIM () { 67 }
  113. sub EUSERS () { 68 }
  114. sub EDQUOT () { 69 }
  115. sub ESTALE () { 70 }
  116. sub EREMOTE () { 71 }
  117. sub EBADRPC () { 72 }
  118. sub ERPCMISMATCH () { 73 }
  119. sub EPROGUNAVAIL () { 74 }
  120. sub EPROGMISMATCH () { 75 }
  121. sub EPROCUNAVAIL () { 76 }
  122. sub ENOLCK () { 77 }
  123. sub ENOSYS () { 78 }
  124. sub EFTYPE () { 79 }
  125.  
  126. sub TIEHASH { bless [] }
  127.  
  128. sub FETCH {
  129.     my ($self, $errname) = @_;
  130.     my $proto = prototype("Errno::$errname");
  131.     if (defined($proto) && $proto eq "") {
  132.     no strict 'refs';
  133.         return $! == &$errname;
  134.     }
  135.     require Carp;
  136.     Carp::confess("No errno $errname");
  137.  
  138. sub STORE {
  139.     require Carp;
  140.     Carp::confess("ERRNO hash is read only!");
  141. }
  142.  
  143. *CLEAR = \&STORE;
  144. *DELETE = \&STORE;
  145.  
  146. sub NEXTKEY {
  147.     my($k,$v);
  148.     while(($k,$v) = each %Errno::) {
  149.     my $proto = prototype("Errno::$k");
  150.     last if (defined($proto) && $proto eq "");
  151.     
  152.     }
  153.     $k
  154. }
  155.  
  156. sub FIRSTKEY {
  157.     my $s = scalar keys %Errno::;
  158.     goto &NEXTKEY;
  159. }
  160.  
  161. sub EXISTS {
  162.     my ($self, $errname) = @_;
  163.     my $proto = prototype($errname);
  164.     defined($proto) && $proto eq "";
  165. }
  166.  
  167. tie %!, __PACKAGE__;
  168.  
  169. 1;
  170. __END__
  171.  
  172. =head1 NAME
  173.  
  174. Errno - System errno constants
  175.  
  176. =head1 SYNOPSIS
  177.  
  178.     use Errno qw(EINTR EIO :POSIX);
  179.  
  180. =head1 DESCRIPTION
  181.  
  182. C<Errno> defines and conditionally exports all the error constants
  183. defined in your system C<errno.h> include file. It has a single export
  184. tag, C<:POSIX>, which will export all POSIX defined error numbers.
  185.  
  186. C<Errno> also makes C<%!> magic such that each element of C<%!> has a non-zero
  187. value only if C<$!> is set to that value, eg
  188.  
  189.     use Errno;
  190.     
  191.     unless (open(FH, "/fangorn/spouse")) {
  192.         if ($!{ENOENT}) {
  193.             warn "Get a wife!\n";
  194.         } else {
  195.             warn "This path is barred: $!";
  196.         } 
  197.     } 
  198.  
  199. =head1 AUTHOR
  200.  
  201. Graham Barr <gbarr@pobox.com>
  202.  
  203. =head1 COPYRIGHT
  204.  
  205. Copyright (c) 1997-8 Graham Barr. All rights reserved.
  206. This program is free software; you can redistribute it and/or modify it
  207. under the same terms as Perl itself.
  208.  
  209. =cut
  210.  
  211.